package com.bwie.controller;

import com.bwie.pojo.TbStudent;
import com.bwie.service.StudentService;
import com.bwie.util.R;
import com.bwie.vo.BindVo;
import com.bwie.vo.PageVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @program: day0617mounth
 * @ClassName StudentController
 * @description:
 * @author: 段阳
 * @create: 2024-06-17 10:23
 **/
@RestController
@RequestMapping("stu")
public class StudentController {

    @Autowired
    private StudentService studentService;
    /**
    * //TODO
    * @author 段阳
    * @date 2024/6/17 11:18
     * @param pageVo
     * @return com.bwie.util.R
    */
    @PostMapping("/findStuList")
    public R findStuList(@RequestBody PageVo pageVo){
        return studentService.findStuList(pageVo);
    }

    /**
     * //TODO
     * @author 段阳
     * @date 2024/6/17 11:18
     * @param tbStudent
     * @return com.bwie.util.R
     */
    @PostMapping("/addStuInfo")
    public R addStuInfo(@RequestBody TbStudent tbStudent){
        return studentService.addStuInfo(tbStudent);
    }


    /**
     * //TODO
     * @author 段阳
     * @date 2024/6/17 11:18
     * @param bindVo
     * @return com.bwie.util.R
     */
    @PostMapping("/bindStuToClass")
    public R bindStuToClass(@RequestBody BindVo bindVo){
        return studentService.bindStuToClass(bindVo);
    }

//    /**
//     * //TODO
//     * @author 段阳
//     * @date 2024/6/17 11:18
//     * @return com.bwie.util.R
//     */
//    @PostMapping("/findClassList")
//    public R findClassList(){
//        return studentService.findClassList(0);
//    }

    /**
     * //TODO
     * @author 段阳
     * @date 2024/6/17 11:18
     * @return com.bwie.util.R
     */
    @PostMapping("/findCityList")
    public R findCityList(@RequestParam(name = "pid") Integer pid){
        return studentService.findCityList(pid);
    }


    /**
     * //TODO
     * @author 段阳
     * @date 2024/6/17 11:18
     * @return com.bwie.util.R
     */
    @PostMapping("/findSchoolList")
    public R findSchoolList(){
        return studentService.findSchoolList();
    }

    /**
     * //TODO
     * @author 段阳
     * @date 2024/6/17 11:18
     * @return com.bwie.util.R
     */
    @PostMapping("/findCollegeList")
    public R findCollegeList(@RequestParam(name = "sid") Integer sid){

        return studentService.findCollegeList(sid);

    }

    /**
     * //TODO
     * @author 段阳
     * @date 2024/6/17 11:18
     * @return com.bwie.util.R
     */
    @PostMapping("/findClassList")
    public R findClassList(@RequestParam(name = "id") Integer id){
        return studentService.findClassList(id);
    }

    /**
     * //TODO
     * @author 段阳
     * @date 2024/6/17 11:18
     * @return com.bwie.util.R
     */
    @PostMapping("/getIdCardInfo")
    public R getIdCardInfo(@RequestParam(name = "idCard") String idCard){
        return studentService.getIdCardInfo(idCard);
    }

    /**
     * //TODO
     * @author 段阳
     * @date 2024/6/17 11:18
     * @return com.bwie.util.R
     */
    @PostMapping("/getMobileInfo")
    public R getMobileInfo(@RequestParam(name = "mobile") String mobile){
        return studentService.getMobileInfo(mobile);
    }
}